package abstracts;

/**
 * @Author admin
 * @Date 2019/3/20 10:35
 */
public class Triangle extends Shape {
    double bottom, high;
    Triangle(){

    }
    Triangle(double bottom,double high){
        this.bottom=bottom;
        this.high=high;
    }

    @Override
    public double area() {
        return bottom * high / 2;
    }

    @Override
    public String getName() {
        return "三角形";
    }

    @Override
    public void output() {
        System.out.println(getName() + "面积是：" + area());
    }
}
